package com.medical.medical.mapper;

import com.medical.medical.entity.Notice;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface NoticeMapper {


    /**
     * @description 根据条件查询系统更新公告条数
     * @author GUOYN
     * @date 2022-09-15 09:22:34  * @param startTime
     * @param terminationTime
     * @return {@link int}
     */
    int getNoticeCount(@Param("startTime") Date startTime,
                       @Param("terminationTime") Date terminationTime,
                       @Param("noticeType") int noticeType) throws Exception;
    /**
      * @description 根据条件查询系统更新公告
      * @author GUOYN
      * @date 2022-09-15 09:38:35  * @param startTime
     * @param terminationTime
     * @param noticeType
     * @param start
     * @param pageSize
      * @return {@link List< Notice>}
      */
    List<Notice> getSystemNoticeList(@Param("startTime") Date startTime,
                                     @Param("terminationTime") Date terminationTime,
                                     @Param("noticeType") int noticeType,
                                     @Param("start") int start,
                                     @Param("pageSize") int pageSize) throws Exception;
    /**
     * @description 根据id获得当前系统更新公告
     * @author GUOYN
     * @date 2022-09-15 12:14:20  * @param id
     * @return {@link Notice}
     */
    Notice getSystemNoticeView(@Param("id") int id,
                               @Param("noticeType") int noticeType) throws Exception;
    /**
      * @description 添加系统更新公告
      * @author GUOYN
      * @date 2022-09-15 14:43:24  * @param notice
      * @return {@link int}
      */
    int addSystemNotice(Notice notice) throws Exception;
    /**
     * @description 修改系统更新公告（发布状态/发布时间）
     * @author GUOYN
     * @date 2022-09-15 15:19:40  * @param notice
     * @return {@link int}
     */
    int updateSystemNotice(Notice notice) throws Exception;

    /*
     * @description: 后台管理查询所有公告
     * @author: qin
     * No such property: code for class: Script1
     * @return:
     * @time: 2022/9/24 11:25
     */
    List<Notice> getAllNotice();

    /*
     * @description: 公告后台管理,根据名称模糊查询公告
     * @author: qin
     * No such property: code for class: Script1
     * @return:
     * @time: 2022/9/24 11:25
     */
    List<Notice> getNoticeByNoticeName(@Param("noticeName") String noticeName);

    /**
     * 根据id删除公告
     * @param noticeId
     * @return
     */
    int deleteById(@Param("noticeId") String noticeId);

    /*
     * @author: 添加公告
     * @description: 
     * No such property: code for class: Script1
     * @return: 
     * @time: 2022/9/24 12:08
     */
    int addNotice(Notice notice);
    /**
     * @description 查询最新公告信息
     * @author GUOYN
     * @date 2022-09-26 11:19:51  * @param
     * @return {@link Notice}
     */
    Notice getNewSystemNoticeView() throws Exception;
}
